@extends('default.layouts.adminPublic')
@section('title', '商家推广记录')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin/activity_com_red_packet')}}">首页</a> &raquo; 商家管理列表
    </div>
    <!--导航结束-->
    <!--结果集标题与导航组件 开始-->
    <div class="con">
        <div class="conMain">
            <div class="result_wrap">
                <div class="search">
                    <span style="margin-right: 20px;"><a href="{{url('admin/activity_per_red_packet/create')}}"><i class="fa fa-plus"></i>添加商家管理</a></span>
                    <span ><a href="{{url('admin/activity_per_red_packet')}}"><i class="fa fa-recycle"></i>商家管理列表</a></span>
                </div>
                <div class="message"><p>目前共查找到<strong>{{$log->total()}}</strong>个商家记录！且每页显示商家记录{{$log->perPage()}}个。</p></div>
            </div>

            <div class="manage">
                @include('flash::message')
            </div>
            <div class="conInfo">
                <div class="conAddList">
                    <dl>
                    <dt><i class="require">*</i>商户基本信息：</dt>
                    <dd>
                        <span class="shop">商户名称：</span><span>{{$red_packet->name}}</span>
                        <span class="shop">商户地址：</span><span>{{$red_packet->address}}</span>
                        <span class="shop">商户联系人：</span><span>{{$red_packet->contact}}</span>
                        <span class="shop">商户联系方式：</span><span>@if(!empty($red_packet->mobile)&&!empty($red_packet->telephone)){{$red_packet->mobile.'/'.$red_packet->telephone}}@elseif(!empty($red_packet->mobile)){{$red_packet->mobile}}@else{{$red_packet->telephone}}@endif</span>
                    </dd>
                    </dl>
                    <dl>
                    <dt><i class="require">*</i>商户账户信息：</dt>
                    <dd>
                        <span class="shop">累计领取：</span><span>{{$red_packet->receive_num}}&nbsp;元</span>
                        <span class="shop">累计下载：</span><span>{{$red_packet->download}}&nbsp;次</span>
                        <span class="shop">单个红包金额：</span><span>{{$red_packet->money}}&nbsp;元</span>
                        <span class="shop">商户余额：</span><span>{{$red_packet->account_balance}}&nbsp;元</span>
                    </dd>
                    </dl>
                </div>
                <div class="conList" id="conList">
                    <dl class="one">
                        <dt><input name="selectall" type="checkbox" value="1" onclick="CheckAll(this)" /></dt>
                        <dd class="pc1">记录编号</dd>
                        <dd class="pc2">个人用户名</dd>
                        <dd class="pc3">个人手机号码</dd>
                        <dd class="pc4">个人注册uid</dd>
                        <dd class="pc5">领取时间</dd>
                    </dl>
                    @if($log->count() > 0 )
                        @foreach($log as $v)
                            <dl id="list{{$v->id}}">
                                <dt><input name="selected_id[]" type="checkbox" value="{{$v->id}}" /></dt>
                                <dd class="pc1">{{$v->id}}</dd>
                                <dd class="pc2">{{$v->per_username}}</dd>
                                <dd class="pc3">{{$v->per_mobile}}</dd>
                                <dd class="pc4">{{$v->per_uid}}</dd>
                                <dd class="pc5">{{$v->receive_at}}</dd>
                            </dl>
                        @endforeach
                    @else
                        <div class="nullcon">对不起！没有符合条件的商家记录！</div>
                    @endif
                    <dl class="last">
                        <dt>
                            <input name="selectall" id="selectall" type="checkbox" value="1" onclick="CheckAll(this)" />
                            <label for="selectall">全选</label>
                        </dt>
                    </dl>
                </div>
                <div class="page_list" style="width: 100%; float: left; margin-top:15px;">
                    {!! $log->links() !!}
                </div>
            </div>
            <div class="stopper" style="margin-top:10px; border-top: 1px solid #e5e5e5"></div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script>
        //全选中与全不选中职位资料
        function CheckAll(form){
            if (form.checked==true){
                for (var i=0;i<document.thisForm.elements.length;i++){
                    var e = document.thisForm.elements[i];
                    if (e.name == 'selectedid' || e.name=='selected_id[]' || e.name=='selectall')
                        e.checked=true;
                }
            }else{
                for (var i=0;i<document.thisForm.elements.length;i++){
                    var e = document.thisForm.elements[i];
                    if (e.name == 'selectedid' || e.name=='selected_id[]' || e.name=='selectall')
                        e.checked=false;
                }
            }
        }
    </script>
@endsection